package com.junqi.live.room.infra.basic.rpc;

import com.junqi.live.room.infra.basic.entity.SysUserRpc;
import com.junqi.sys.api.UserFeignService;
import com.junqi.sys.entity.SysUserDto;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class UserRpc {

    @Resource
    private UserFeignService userFeignService;

    public SysUserRpc getUserInfoByUserId(String userId) {
        SysUserDto user = userFeignService.getUserInfoByUserId(userId);
        SysUserRpc userRpc=new SysUserRpc();
        userRpc.setId(user.getId());
        userRpc.setUserName(user.getUserName());
        userRpc.setRoleId(user.getRoleId());
        return userRpc;
    }

}
